import Vue from "vue";
import {
  Breadcrumb,
  BreadcrumbItem,
  Button,
  Checkbox,
  CheckboxGroup,
  Col,
  Collapse,
  ColorPicker,
  Content,
  Dropdown,
  DropdownItem,
  DropdownMenu,
  Form,
  FormItem,
  Header,
  Icon,
  Input,
  InputNumber,
  Sider,
  Submenu,
  Layout,
  LoadingBar,
  Menu,
  MenuItem,
  Message,
  Modal,
  Option,
  Page,
  Row,
  Select,
  Slider,
  Table,
  Tabs,
  TabPane,
  RadioGroup,
  Radio,
  Spin,
  Notice,
  Upload
} from "iview";
Vue.prototype.$Modal = Modal;
Vue.prototype.$Message = Message;
Vue.prototype.$Notice = Notice;
const components = {
  Breadcrumb,
  BreadcrumbItem,
  Button,
  Checkbox,
  CheckboxGroup,
  Col,
  Collapse,
  ColorPicker,
  Content,
  Dropdown,
  DropdownItem,
  DropdownMenu,
  Form,
  FormItem,
  Header,
  Icon,
  Input,
  InputNumber,
  Sider,
  Submenu,
  Layout,
  LoadingBar,
  Menu,
  MenuItem,
  Message,
  Modal,
  Option,
  Page,
  Row,
  Select,
  Slider,
  Table,
  Tabs,
  TabPane,
  Upload,
  RadioGroup,
  Radio,
  Spin,
  Notice
};
const iviewModule = {
  ...components,
  //添加别名(除了Switch、Circle在使用中必须是iSwitch、iCircle,其他都可以不加"i")
  iCol: Col,
  iButton: Button,
  iInput: Input,
  iSelect: Select
};
// 循环注册全局组件
Object.keys(iviewModule).forEach(key => {
  Vue.component(key, iviewModule[key]);
});
